const { ipcMain } = require('electron');
const { runPlugin, runSysPluginByName } = require('../../biz/baseService/runPlugin');
const { searchPlugin } = require('../../biz/baseService/searchService/searchServiceImpl');
const { switchHide } = require('../../biz/baseService/mainWinConfig');

exports.search = function () {
    ipcMain.on('baseService.search', async (event, request) => {
        searchPlugin(event, request)
    })
}

exports.runPlugin = function () {

    ipcMain.on('baseService.runPlugin', async (event, request) => {
        runPlugin(event, request)
        // const data = runPlugin(event, request)
        // event.sender.send('baseService.runPlugin-reply', data)
    })
}

exports.switchHide = function () {
    ipcMain.on('baseService.switchHide', async (event, request) => {
        switchHide(event, request)
    })
}




exports.runSysPluginByName = function () {
    ipcMain.on('baseService.runSysPluginByName', (event, request) => {
        runSysPluginByName(event, request)
    })
}


